﻿@model IEnumerable<Ja.Mvc.Acdf.Models.AcdfGuessBook>

@{
    ViewBag.Title = "GuessBook";
}

<h2>@ViewBag.Title</h2>

<p>@Html.ActionLink("Sign GuessBook", "Create", "GuessBook")</p>

<!-- container -->
<div class="container">
    @foreach (var item in Model)
    {

        <div class="panel panel-default">
            <div class="panel-heading">
                <b>@Html.DisplayFor(modelItem => item.AspNetUser.FirstName) @Html.DisplayFor(modelItem => item.AspNetUser.LastName) </b><em>(@Html.DisplayFor(modelItem => item.AspNetUser.Pseudo))</em><br />
            </div>
            <div class="panel-body">
                <p>
                    <img src="@item.AspNetUser.AvatarUrl" title="@item.AspNetUser.FirstName @item.AspNetUser.LastName" alt="@item.AspNetUser.FirstName @item.AspNetUser.LastName" />
                </p>
                <p>
                    @Html.TextAreaFor(modelItem => item.Message, new { @class = "border-box", @readonly = true, rows = "3", disabled = true })
                </p>
            </div>

            <div class="panel-footer">
                <em class="pull-right">@Html.DisplayFor(modelItem => item.Date)</em><br />
               @if ((User.Identity.Name == item.AspNetUser.UserName) || (User.IsInRole("Admin")))
                {
                    <div>
                        @Html.ActionLink("Edit", "Edit", new { id = item.Id }) |
                        @Html.ActionLink("Delete", "Delete", new { id = item.Id })
                    </div>
                }

            </div>
        </div>

        @*<div class="media">
        <a class="pull-left" href="#">
            <img class="media-object" src="@item.AspNetUser.AvatarUrl" alt="@item.AspNetUser.UserName">
        </a>
        <div class="media-body">
            <h4 class="media-heading">
                <b>@Html.DisplayFor(modelItem => item.Date)</b><br />
                <b>@Html.DisplayFor(modelItem => item.AspNetUser.UserName)</b><br />
            </h4>
            @Html.DisplayFor(modelItem => item.Message, new { rows = "5", cols = "80", @readonly = true })
        </div>
    </div>*@

    }
</div><!-- container -->